﻿using Simple.Framework.Configuration;
using Simple.Framework.Ioc;
using Simple.Framework.Schedule;
using Simple.PrettyNet.Handle;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using IContainer = Simple.Framework.Ioc.IContainer;

/*********************************************************
 * 命名空间 Simple.BasicNet.Core.Net
 * 接口名称 IHost
 * 开发人员：11920
 * 创建时间：2023/4/7 17:29:14
 * 描述说明：
 * 更改历史：
 * 
 * *******************************************************/
namespace Simple.PrettyNet.Net
{
	public interface IHost
	{
		public IHost Start();
		
		/// <summary>
		/// 
		/// </summary>
		/// <param name="ConfigurationPath"></param>
		/// <returns></returns>
		public IHost SetConfiguration<TConfiguration>(string ConfigurationPath) where TConfiguration : IConfiguration;


		public IHost SetConfiguration<TConfiguration>() where TConfiguration : IConfiguration;

		public IHost SetConfiguration(string ConfigurationPath);
		
		/// <summary>
		/// 
		/// </summary>
		/// <param name="SetConfigution"></param>
		/// <returns></returns>
		public IHost SetConfiguration(Action<IConfiguration> SetConfigution);
		
		/// <summary>
		/// 替换容器之后需要重新注册
		/// </summary>
		/// <returns></returns>
		public IHost ReplaceContainer(IContainer container);
		
		/// <summary>
		/// 
		/// </summary>
		/// <param name="action"></param>
		/// <returns></returns>
		/// <exception cref="ArgumentNullException"></exception>
		public IHost Regster(Action<IContainer> action);
	
		/// <summary>
		/// 注册任务然后启动任务
		/// </summary>
		/// <param name="action"></param>
		/// <returns></returns>
		/// <exception cref="ArgumentNullException"></exception>
		/// 
		public IHost RegisterSchedule(Action<IScheduleManager> action);
		
		/// <summary>
		/// 
		/// </summary>
		/// <typeparam name="TMessageHandle"></typeparam>
		/// <returns></returns>
		public IHost ConfigutionMessageHandle<TMessageHandle>() where TMessageHandle : IMessageHandle;
	}
}
